

#include "NoticeCommonEx.h"

//#include "../share/StringFactory.h"
#include <iostream>

//-------------------------------------------------------------------------------
NoticeCommonEx::NoticeCommonEx(void)
	: m_option_1(nullptr)
	, m_option_2(nullptr)
	, m_option_3(nullptr)
	, m_user_1(0)
	, m_user_2(0)
	, m_user_3(0)
	, m_user_4(0)
	, m_user_5(0)
	, m_user_6(0)
	, m_user_7(0)
{
	_safe_guard_begin;
	_safe_guard_end;
}

//-------------------------------------------------------------------------------
NoticeCommonEx::~NoticeCommonEx(void)
{

	clear();

}

//-------------------------------------------------------------------------------
void NoticeCommonEx::NoticeStart(void)
{
	_safe_guard_begin;

	clear();

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::NoticeFinish(void)
{
	_safe_guard_begin;
	
	Display();

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetOption1(const char* val)
{
	_safe_guard_begin;

	m_option_1 = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetOption2(const char* val)

{
	_safe_guard_begin;

	m_option_2 = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetOption3(const char* val)
{
	_safe_guard_begin;

	m_option_3 = string_factory::CreateString(val);

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetUserVal1(uint32_t val)
{
	_safe_guard_begin;
	
	m_user_1 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetUserVal2(uint32_t val)
{
	_safe_guard_begin;

	m_user_2 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetUserVal3(uint32_t val)
{
	_safe_guard_begin;
	
	m_user_3 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetUserVal4(uint32_t val)
{
	_safe_guard_begin;

	m_user_4 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetUserVal5(uint32_t val)
{
	_safe_guard_begin;

	m_user_5 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetUserVal6(uint32_t val)
{
	_safe_guard_begin;

	m_user_6 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::SetUserVal7(uint32_t val)
{
	_safe_guard_begin;

	m_user_7 = val;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::Display(void)
{
	_safe_guard_begin;
	
	std::cout << std::endl;
	std::cout
		<< "m_user_1: " << m_user_1 << '\t'
		<< "m_user_2: " << m_user_2 << '\t'
		<< "m_user_3: " << m_user_3 << '\t'
		<< "m_user_4: " << m_user_4 << '\t'
		<< "m_user_5: " << m_user_5 << '\t'
		<< "m_user_6: " << m_user_6 << '\t'
		<< "m_user_7: " << m_user_7 << std::endl;
	if (m_option_1)
		std::cout << *m_option_1 << std::endl;
	if (m_option_2)
		std::cout << *m_option_2 << std::endl;
	if (m_option_3)
		std::cout << *m_option_3 << std::endl;

	_safe_guard_end;
}

//-------------------------------------------------------------------------------
std::string * NoticeCommonEx::GetOption1(void)
{
	_safe_guard_begin;

	return m_option_1;

	_safe_guard_end;

	return nullptr;
}

//-------------------------------------------------------------------------------
std::string * NoticeCommonEx::GetOption2(void)
{
	_safe_guard_begin;

	return m_option_2;

	_safe_guard_end;

	return nullptr;
}

//-------------------------------------------------------------------------------
std::string * NoticeCommonEx::GetOption3(void)
{
	_safe_guard_begin;

	return m_option_3;

	_safe_guard_end;

	return nullptr;
}

//-------------------------------------------------------------------------------
uint32_t NoticeCommonEx::GetUserVal1(void)
{
	_safe_guard_begin;

	return m_user_1;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t NoticeCommonEx::GetUserVal2(void)
{
	_safe_guard_begin;

	return m_user_2;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t NoticeCommonEx::GetUserVal3(void)
{
	_safe_guard_begin;

	return m_user_3;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t NoticeCommonEx::GetUserVal4(void)
{
	_safe_guard_begin;

	return m_user_4;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t NoticeCommonEx::GetUserVal5(void)
{
	_safe_guard_begin;

	return m_user_5;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t NoticeCommonEx::GetUserVal6(void)
{
	_safe_guard_begin;

	return m_user_6;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
uint32_t NoticeCommonEx::GetUserVal7(void)
{
	_safe_guard_begin;

	return m_user_7;

	_safe_guard_end;

	return 0;
}

//-------------------------------------------------------------------------------
void NoticeCommonEx::clear(void)
{
	_safe_guard_begin;

	if (m_option_1)
	{
		string_factory::FreeString(m_option_1);
		m_option_1 = nullptr;
	}
		

	if (m_option_2)
	{
		string_factory::FreeString(m_option_2);
		m_option_2 = nullptr;
	}
		

	if (m_option_3)
	{
		string_factory::FreeString(m_option_3);
		m_option_3 = nullptr;
	}
		

	m_user_1 = 0;
	m_user_2 = 0;
	m_user_3 = 0;
	m_user_4 = 0;
	m_user_5 = 0;
	m_user_6 = 0;
	m_user_7 = 0;
		
	_safe_guard_end;
}
